import inherits from 'inherits-browser'

import BaseRenderer from 'diagram-js/lib/draw/BaseRenderer'

import {
  is
} from 'bpmn-js/lib/util/ModelUtil'

import Cat from '../cat'

import {
  append as svgAppend, attr as svgAttr,
  create as svgCreate
} from 'tiny-svg'
import { getFillColor, getStrokeColor } from 'bpmn-js/lib/draw/BpmnRenderUtil'

export default function NyanRender(eventBus) {
  BaseRenderer.call(this, eventBus, 1500)

  this.canRender = function(element) {
    return is(element, 'bpmn:ExclusiveGateway')
  }

  this.drawShape = function(parent, shape) {
    var url = Cat.dataURL

    var catGfx = svgCreate('path', {
      x: 0,
      y: 0,
      width: 100,
      height: 80,
      d: 'M-4.60250013492679,42.40809078265114 L53.397500726894,-2.5919135606366597 L111.39750158871558,42.40809078265114 L53.397500726894,87.4080951259391 L-4.60250013492679,42.40809078265114 z',
      strokeWidth: 1,
      fill: 'white',
      stroke: 'black'
    })


    svgAppend(parent, catGfx)

    return catGfx
  }
}

inherits(NyanRender, BaseRenderer)

NyanRender.$inject = ['eventBus']
